﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using xiaodingmarket_Domain_core.Models;
using static xiaodingmarket_Domain.Models.EunmType;

namespace xiaodingmarket_Domain.Models
{
    public class OrderCommodity:AggregateRoot
    {
        public OrderCommodity()
        {

        }
        public OrderCommodity(Guid id ,OrderDetail orderDetail, Guid buyer, Guid seller, OrderCondition condition, DateTime logTime, DateTime modifyTime, Guid createUserId, Guid modifyUserId, string remark, string address, bool isDelete)
        {
            Id = id;
            OrderDetail = orderDetail;
            Buyer = buyer;
            Seller = seller;
            Condition = condition;
            LogTime = logTime;
            ModifyTime = modifyTime;
            CreateUserId = createUserId;
            ModifyUserId = modifyUserId;
            Remark = remark;
            Address = address;
            IsDelete = isDelete;
        }

        /// <summary>
        /// 商品订单详情(实体)
        /// </summary>
        public OrderDetail OrderDetail { get; set; }
        /// <summary>
        /// 购买者或者接悬赏的id
        /// </summary>
        public Guid Buyer { get; set; }
        /// <summary>
        /// 发布者id
        /// </summary>
        public Guid Seller { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public OrderCondition Condition { get; set; }
        /// <summary>
        /// 生成订单时间
        /// </summary>
        public DateTime LogTime { get; set; }
        /// <summary>
        /// 最后一次修改订单时间
        /// </summary>
        public DateTime ModifyTime { get; set; }
        /// <summary>
        /// 创建订单者id
        /// </summary>
        public Guid CreateUserId { get; set; }
        /// <summary>
        /// 修改订单者id
        /// </summary>
        public Guid ModifyUserId { get; set; }
        /// <summary>
        /// 订单备注
        /// </summary>
        [Column(TypeName = "varchar(500)")]
        public string Remark { get; set; }
        /// <summary>
        /// （收货地址）作为补充
        /// </summary>
        [Column(TypeName = "varchar(200)")]
        public string Address { get; set; }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        public bool IsDelete { get; set; }
    }
}
